﻿package com.zit.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import com.zit.entity.Bedroom;

public class BedroomDAO extends BaseDAO {
	
	/**
	 * 作者:唐美兰
	 * 功能:根据公寓Id查询公寓下面的所有寝室
	 * @return
	 */
	public List<Bedroom> select(int did,Session s){
		Query query = s.createQuery("select new Bedroom(b.id,b.name) from Bedroom b where b.dorm.id=:did").setParameter("did", did);
		return query.list();
	}
}
